.request-modal {
    --title-height: 92px;

    position: fixed;
    z-index: 11;
    right: 0;
    top: 0;
    bottom: 0;
    left: auto;
    background: var(--white);
    color: var(--gray700);
    font-size: 14px;
    box-sizing: border-box;
    width: 460px;
    max-width: 100%;
    box-shadow: 2px 2px 10px var(--shadow);
    overflow: auto;
    max-height: 100%;
    background: linear-gradient(white, rgba(255, 255, 255, 0)), radial-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, 0));
    background-size: 100% var(--title-height), 100% 2px;
    background-repeat: no-repeat;
    background-color: var(--white);
    background-attachment: local, scroll;
    background-position-y: var(--title-height);
    display: flex;
    flex-direction: column;

    @media (max-width: 640px) {
        width: 100%;
    }

    @media (prefers-color-scheme: dark) {
        background: var(--black);
        color: var(--gray400);
        border-left: 1px solid var(--gray900);
    }

    &__content {
        flex: 1;
        overflow-y: auto;
        background-color: var(--white);

        @media (prefers-color-scheme: dark) {
            background: var(--black);
        }
    }

    &__overlay {
        position: static;
    }

    &__title {
        display: flex;
        align-items: center;
        padding: 32px 28px 32px;
        background: var(--white);

        @media (prefers-color-scheme: dark) {
            background: var(--black);

            &_fixed {
                border-bottom: 1px solid var(--gray900);
                box-shadow: none;
            }
        }

        @media (max-width: 640px) {
            padding: 24px 16px 32px;
        }

        &_fixed {
            z-index: 1;
            box-shadow: 0px 0px 32px rgba(0, 0, 0, 0.1);
            border: none;
        }
    }

    &__header {
        font-size: 24px;
        color: var(--gray900);
        letter-spacing: 0;
        text-align: center;
        margin: 0 8px;

        @media (prefers-color-scheme: dark) {
            color: var(--gray300);
        }
    }

    &__navigation {
        background-color: transparent;
        border: none;
        outline: none;
        background-position: center;
        background-repeat: no-repeat;
        padding: 0;
        background-size: 12px;

        &--close {
            width: 24px;
            height: 24px;
            color: var(--gray900);

            @media (prefers-color-scheme: dark) {
                color: var(--gray300);
            }
        }

        &--back {
            width: 14px;
            height: 16px;
            color: var(--gray700);

            @media (prefers-color-scheme: dark) {
                color: var(--gray400);
            }
        }

        &:hover {
            cursor: pointer;
        }
    }

    &__controls {
        margin-top: auto;
        padding: 0 32px;
        justify-content: space-between;

        @media (max-width: 640px) {
            margin-top: 28px;
            padding: 0 24px;
        }

        &_fixed {
            z-index: 1;
            box-shadow: 0px 0px 32px rgba(0, 0, 0, 0.1);
            border: none;

            @media (prefers-color-scheme: dark) {
                border-top: 1px solid var(--gray900);
                box-shadow: none;
            }
        }
    }

    &__button {
        border: none;
        padding: 9px 7px;
        cursor: pointer;
        font-size: 13px;
        color: var(--white);
        line-height: 8px;
        background: var(--btnGreen);
        border-radius: 8px;
        height: 48px;
        text-transform: uppercase;
        width: 183px;
        margin: 24px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;

        @media (min-width: 641px) {
            margin-right: 24px;

            &:last-child {
                margin-right: 0;
            }
        }

        @media (max-width: 640px) {
            width: 100%;
            margin: 8px 0;
        }

        &--white {
            background-color: var(--white);
            color: var(--gray900);
            border: 1px solid var(--gray700);

            @media (prefers-color-scheme: dark) {
                color: var(--gray300);
                background-color: var(--black);
                border: 1px solid var(--gray400);
            }
        }

        &--red {
            background-color: var(--red400);
            color: var(--white);
        }

        &:focus {
            outline: none;
        }
    }

    &__url-button {
        display: inline-block;
        cursor: pointer;
        margin-top: 8px;
        margin-right: 16px;
        color: var(--green700);
        padding-bottom: 1px;

        &:hover {
            padding-bottom: 0;
            border-bottom: 1px solid var(--green700);
        }

        @media (prefers-color-scheme: dark) {
            color: var(--green400);
        }
    }

    &__dragbar {
        position: absolute;
        height: 100%;
        box-sizing: border-box;
        cursor: col-resize;
        border: 1px solid transparent;
    }

    &__text {
        padding: 0 6px;
        margin: 0 32px;
        border: 1px solid #D8D8D8;
        height: calc(100vh - 225px);
        overflow-y: scroll;

        code {
            word-break: break-all;
            white-space: break-spaces;
        }
    }
}

.light-mode {
    & .request-modal {
        border-left: 0;
        background: var(--white);
        color: var(--gray700);

        &__content {
            background-color: var(--white);
        }

        &__title {
            background: var(--white);

            &_fixed {
                box-shadow: 0px 0px 32px rgba(0, 0, 0, 0.1);
                border: none;
            }
        }

        &__controls {
            &_fixed {
                box-shadow: 0px 0px 32px rgba(0, 0, 0, 0.1);
                border: none;
            }
        }

        &__header {
            color: var(--gray900);
        }


        &__navigation {
            &--close {
                color: var(--gray900);
            }

            &--back {
                color: var(--gray700);
            }
        }

        &__button {
            &--white {
                color: var(--gray900);
                background-color: var(--white);
                border: 1px solid var(--gray700);
            }
        }
    }
}

.dark-mode {
    .request-modal {
        background: var(--black);
        color: var(--gray400);
        border-left: 1px solid var(--gray900);

        &__content {
            background: var(--black);
        }

        &__title {
            background: var(--black);

            &_fixed {
                border-bottom: 1px solid var(--gray900);
                box-shadow: none;
            }
        }

        &__controls {
            &_fixed {
                border-top: 1px solid var(--gray900);
                box-shadow: none;
            }
        }

        &__header {
            color: var(--gray300);
        }

        &__navigation {
            &--close {
                color: var(--gray300);
            }

            &--back {
                color: var(--gray400);
            }
        }

        &__button {
            &--white {
                color: var(--gray300);
                background-color: var(--black);
                border: 1px solid var(--gray400);
            }
        }
    }
}
